import { defineUserConfig } from 'vuepress'
// import type { DefaultThemeOptions } from "vuepress";
import recoTheme from 'vuepress-theme-reco'
import { viteBundler } from '@vuepress/bundler-vite'
import { templateCompilerOptions } from '@tresjs/core'

export default defineUserConfig({
  title: 'TvT.js',
  head: [
    ['link', { rel: 'icon', href: '/logo.png' }],
    [
      'script',
      {},
      `var _hmt = _hmt || [];
  (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?9ac430d309361163bdc69ddf76548960";
    var s = document.getElementsByTagName("script")[0]; 
    s.parentNode.insertBefore(hm, s);
  })();`,
    ],
  ],
  description:
    'ICEGL图形学社区是一个热衷于计算机图形学和视觉效果的开源社区。我们汇聚了一群热爱创造和探索的开发者、设计师和研究人员，共同致力于推动图形学领域的创新和发展。',
  theme: recoTheme({
    style: '@vuepress-reco/style-default',
    primaryColor: '#1f86e6',
    logo: '/logo.png',
    // author: "icegl",
    authorAvatar: '/head.jpg',
    lastUpdated: false,
    // lastUpdatedText: "...zzzZZZ",
    catalogTitle: '本页目录',
    // series 为原 sidebar
    series: {
      '/docs/three-vue-tres': [
        {
          text: '引导',
          children: [
            '/docs/three-vue-tres/guide/introduction',
            '/docs/three-vue-tres/guide/start',
            '/docs/three-vue-tres/guide/first',
            { text: '📀预览', link: 'https://opensource.icegl.cn/' },
          ],
        },
        {
          text: '基础',
          children: [
            '/docs/three-vue-tres/base/structure',
            '/docs/three-vue-tres/base/config',
            '/docs/three-vue-tres/base/route',
            '/docs/three-vue-tres/base/css',
            '/docs/three-vue-tres/base/resources',
          ],
        },
        {
          text: '三维核心',
          children: [
            '/docs/three-vue-tres/core/variable',
            '/docs/three-vue-tres/core/object',
            '/docs/three-vue-tres/core/geometry',
            '/docs/three-vue-tres/core/material',
            '/docs/three-vue-tres/core/extend',
            '/docs/three-vue-tres/core/event',
            '/docs/three-vue-tres/core/controls',
            '/docs/three-vue-tres/core/processing',
          ],
        },
        {
          text: '前端相关',
          children: [
            '/docs/three-vue-tres/frontend/store',
            '/docs/three-vue-tres/frontend/network',
            '/docs/three-vue-tres/frontend/uniapp',
          ],
        },
        {
          text: 'qiankun微前端',
          children: [
            '/docs/three-vue-tres/qiankun/introduction',
            '/docs/three-vue-tres/qiankun/main',
            '/docs/three-vue-tres/qiankun/microTvt',
            '/docs/three-vue-tres/qiankun/microSample',
            '/docs/three-vue-tres/qiankun/message',
          ],
        },
        {
          text: '插件',
          children: [
            '/docs/three-vue-tres/plugin/introduction',
            '/docs/three-vue-tres/plugin/manage',
            '/docs/three-vue-tres/plugin/directory',
          ],
        },
        {
          text: '区域场景编辑器<新>',
          children: [
            '/docs/three-vue-tres/zoneeditor/introduction',
            '/docs/three-vue-tres/zoneeditor/modelserve',
            '/docs/three-vue-tres/zoneeditor/other',
          ],
        },
        {
          text: 'UI编辑器',
          children: [
            '/docs/three-vue-tres/editor/goview',
            '/docs/three-vue-tres/editor/usegwjson',
          ],
        },
        {
          text: '原生编辑器<旧>',
          children: [
            '/docs/three-vue-tres/editor/threeeditor',
            '/docs/three-vue-tres/editor/totvt',
          ],
        },
        {
          text: '其他',
          children: [
            {
              text: '❔常见问题',
              link: '/docs/three-vue-tres/other/questions',
            },
          ],
        },
      ],
    },
    // autoSetSeries: true,
    navbar: [
      { text: '✨️文档首页', link: '/' },
      { text: '🧩插件市场', link: 'https://www.icegl.cn/tvtstore' },
      { text: '🆓区域场景编辑器', link: 'https://oss.icegl.cn/p/zone3Deditor/' },
      {
        text: '📚相关文档',
        children: [
          {
            text: '🧊 TvT.js',
            link: '/docs/three-vue-tres/guide/introduction',
          },
          {
            text: '🎲 three.js',
            link: 'https://threejs.org/docs/index.html#manual/zh/introduction/Creating-a-scene',
          },
          { text: '⚡ tres.js', link: 'https://tresjs.org/guide/' },
          { text: '💠 fes.js', link: 'https://fesjs.mumblefe.cn/' },
        ],
      },
      { text: '📀预览演示', link: 'https://opensource.icegl.cn/' },
      {
        text: '🧊ICEGL官网社区',
        
        children: [
          {
            text: '🧊ICEGL官网',
            link: 'https://icegl.cn/',
          },
          {
            text: '🙋‍♀️社区问答',
            link: 'https://icegl.cn/ask',
          },
        ]
      },
      {
        text: '👨‍🏫课程中心',
        children: [
          {
            text: '🌁 WebGL初/中/高级教程',
            link: 'https://icegl.cn/courses.html',
          },
          {
            text: '🏙 WebGL Shader初级教程',
            link: 'https://www.bilibili.com/video/BV1iR4y1C7LQ',
          },
          {
            text: '🌇 WebGL Shader中级教程',
            link: 'https://m.study.163.com/provider/480000002303414/index.htm?share=2&shareId=480000002303414',
          },
        ],
      },
      { text: '🪩视频介绍', link: 'https://space.bilibili.com/384558900' },
      { text: '🪅小程序生态', link: 'https://www.icegl.cn/tvtstore/uniAppView' },
      {
        text: '💫关于',
        children: [
          { text: '⛄aboutUs', link: '/docs/about/us' },
          { text: '❔常见问题', link: '/docs/three-vue-tres/other/questions' },
        ],
      },
      // { text: "分类", link: "/categories/reco/1/" },
      // { text: "标签", link: "/tags/tag1/1/" },
    ],
    bulletin: {
      title: '公告',
      body: [
        {
          type: 'text',
          content: `🎉🎉三维可视化项目快速落地的开源框架<br />
          <a style='color: #5d67e8;font-weight: bolder;' href="https://gitee.com/ice-gl/icegl-three-vue-tres" target="_blank">🏕 点击预览：TvT.js<a/><br />
          永久开源且免费商用，持续更新ing<br />
          望大家关注💛 点赞⭐ fork👣支持<br />
          ------------------------------`,
          style: 'font-size: 12px;',
        },
        {
          type: 'text',
          content: `🎊🎊基于TvT.js框架开发的应用和插件市场已上线，欢迎大家试用和反馈<br />
          <a style='color: #5d67e8;font-weight: bolder;' href="https://www.icegl.cn/tvtstore" target="_blank">🧩 点击查看：插件应用市场<a/><br />
          `,
          style: 'font-size: 12px;',
        },
        {
          type: 'hr',
        },
        {
          type: 'text',
          content: `
            <a href="https://space.bilibili.com/384558900" target="_blank">TvT.js B站<a/>
            <a href="https://www.icegl.cn/tvtstore" target="_blank">插件市场<a/>
            <a href="https://www.icegl.cn/ask" target="_blank">问答社区<a/>
            <br />`,
          style:
            'font-size: 12px;display: flex;justify-content: space-around;text-decoration: underline;',
        },
        {
          type: 'text',
          content: `
          <a style="display: flex;justify-content: space-around;">
            <div>
              <img style="width:100px;" src="https://cdn.index.icegl.cn/uploads/20230731/17d59bab46815cce1f4f1e09dcbb6ccc.png">
              <span>微信群</span>
            </div>
            <div>
              <img style="width:100px;" src="https://cdn.index.icegl.cn/uploads/20250207/600d7c73e9c0f5135f0cd63dda309464.png">
              <span>QQ群:795714357</span>
            </div>
          </a>
          `,
          style: 'font-size: 12px;margin-top: 14px; text-align: center;',
        },
        // {
        //   type: "hr",
        // },
        // {
        //   type: "buttongroup",
        //   children: [
        //     {
        //       text: "打赏",
        //       link: "/docs/others/donate.html",
        //     },
        //   ],
        // },
      ],
    },
    // commentConfig: {
    //   type: 'valie',
    //   // options 与 1.x 的 valineConfig 配置一致
    //   options: {
    //     // appId: 'xxx',
    //     // appKey: 'xxx',
    //     // placeholder: '填写邮箱可以收到回复提醒哦！',
    //     // verify: true, // 验证码服务
    //     // notify: true,
    //     // recordIP: true,
    //     // hideComments: true // 隐藏评论
    //   },
    // },
    // algolia: {
    //   appId: 'S9LOLS0U2X',
    //   apiKey: '24a5da50495a929aa5dc971b2c080238',
    //   indexName: 'icegl',
    //   inputSelector: '### 搜索我 ####',
    //   algoliaOptions: { 'facetFilters': ["lang:$LANG"] },
    //   debug: false // Set debug to true if you want to inspect the dropdown
    // },
  }),
  // debug: true,
  bundler: viteBundler({
    viteOptions: {},
    vuePluginOptions: {
      ...templateCompilerOptions,
    },
  }),
})
